Skip to content

perf: don't keep multiple copies of the same mail data in memory - #232

Merged
j-g00da merged 1 commit into
mainfrom
j-g00da/limit-mail-data-clones
Sep 11, 2026
Merged

j-g00da merged 1 commit into
mainfrom
j-g00da/limit-mail-data-clones

Conversation

@j-g00da

@j-g00da j-g00da commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

Uses Bytes instead of Vec<u8>,
to prevent keeping multiple copies of messages
in memory.

Comment thread src/transport/worker.rs
@j-g00da
j-g00da requested a review from link2xt September 11, 2026 06:44
@j-g00da

j-g00da commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator Author

The main improvement is that envelope data is no longer cloned to each worker, which can be problematic on e.g. large groups with people using many different relays. Reduces memory usage of worker queues.

@j-g00da
j-g00da force-pushed the j-g00da/limit-mail-data-clones branch from 5ea2370 to 6ff0d69 Compare September 11, 2026 07:23
Uses `Bytes` instead of `Vec<u8>`,
to prevent keeping multiple copies of messages
in memory.

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
@j-g00da
j-g00da force-pushed the j-g00da/limit-mail-data-clones branch from 6ff0d69 to d4c9d12 Compare September 11, 2026 07:27
@j-g00da
j-g00da requested review from link2xt and removed request for link2xt September 11, 2026 07:29
@j-g00da
j-g00da merged commit b6d05ef into main Sep 11, 2026
7 checks passed
@j-g00da
j-g00da deleted the j-g00da/limit-mail-data-clones branch September 11, 2026 07:36
j-g00da added a commit that referenced this pull request Sep 11, 2026
Leftover I forgot to remove in #232,
this prevents cloning the inner data.

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants